import type { addSystemEmpParamsType, SystemEmpDataType, SystemEmpItemType, SystemEmpListParamsType } from "@/types/systemEmp";
import { myGet, myPost, myRequest } from "@/utils/reuqest";

// 获取员工列表
export const getSystemEmpDataAPI = (params: SystemEmpListParamsType) => {
  return myGet<SystemEmpDataType>('/park/sys/user', params)
}

// 添加员工
export const addSystemEmpAPI = (data: addSystemEmpParamsType) => {
  return myPost('/park/sys/user', data)
}

// 编辑员工
export const editSystemEmpAPI = (data: addSystemEmpParamsType) => {
  return myRequest({
    url: '/park/sys/user',
    method: 'PUT',
    data
  })
}

// 删除员工
export const deleteSystemEmpAPI = (id: number) => {
  return myRequest({
    url: `/park/sys/user/${id}`,
    method: 'DELETE'
  })
}

// 重置密码
export const resetPasswordAPI = (id: number) => {
  return myRequest({
    url: `/park/sys/user/resetPwd`,
    method: 'PUT',
    data: { id }
  })
}